import { request } from '../request';

const baseUrl = '/codegen';
// 定时列表查询
export function fetchGetCodegeneratorList(params: Api.SystemManage.CodegeneratorSearchParams) {
  return request<Api.SystemManage.CodegeneratorList>({
    url: `${baseUrl}/list`,
    method: 'get',
    params
  });
}

// 添加定时任务
export function fetchAddCodegenerator(data: Api.SystemManage.CodegeneratorUpdate) {
  return request<App.Service.Response>({
    url: `${baseUrl}/add`,
    method: 'post',
    data
  });
}

// 更新定时任务
export function fetchUpdateCodegenerator(data: Api.SystemManage.CodegeneratorUpdate) {
  return request<App.Service.Response>({
    url: `${baseUrl}/update`,
    method: 'put',
    data
  });
}

// 删除定时任务
export function fetchDeleteCodegenerator(data: Api.SystemManage.Ids) {
  return request<App.Service.Response>({
    url: `${baseUrl}/delete`,
    method: 'delete',
    data
  });
}